package example.demo.controller;

import example.demo.config.RabbitMQSend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mq/send")
public class SendMessageController {

    @Autowired
    RabbitMQSend rabbitMQSend;

    // http://localhost:8444/mq/send/message?message=Aaaa
    // http://localhost:8444/mq/send/message?message=Baaa
    // http://localhost:8444/mq/send/message?message=Caaa
    @ResponseBody
    @RequestMapping("/message")
    public String sendA(String message) {
        return rabbitMQSend.sendMessage(message);
    }


}
